package com.gxa.modules.datamanagement.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.gxa.modules.datamanagement.form.BasicInformationForm;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;

@Data
@NoArgsConstructor
@TableName("p_basic_information")
public class BasicInformation implements Serializable {
    @TableId(value = "id",type = IdType.AUTO)
    private Integer id;
    @TableField("cell_name")
    private String cellName;
    @TableField("cell_no")
    private String cellNo;

    private String region;
    @TableField("detailed_address")
    private String detailedAddress;
    @TableField("completion_date")
    private Date completionDate;
    @TableField("house_use")
    private String houseUse;
    @TableField("small_area")
    private Integer smallArea;
    @TableField("buildings_number")
    private Integer buildingsNumber;
    @TableField("houses_number")
    private Integer housesNumber;
    @TableField("parking_space_area")
    private Integer parkingSpaceArea;
    @TableField("parking_number")
    private Integer parkingNumber;
    @TableField("community_profile")
    private String communityProfile;

    @TableField("community_picture")
    private String communityPicture;


    public BasicInformation(BasicInformationForm basicInformationForm){
        this.id = basicInformationForm.getId();
        this.cellName = basicInformationForm.getCellName();
        this.cellNo = basicInformationForm.getCellNo();
        this.region = basicInformationForm.getRegion();
        this.detailedAddress = basicInformationForm.getDetailedAddress();
        this.completionDate = basicInformationForm.getCompletionDate();
        this.houseUse = basicInformationForm.getHouse_use();
        this.smallArea = basicInformationForm.getSmallArea();
        this.buildingsNumber = basicInformationForm.getBuildingsNumber();
        this.housesNumber = basicInformationForm.getHousesNumber();
        this.parkingSpaceArea = basicInformationForm.getParkingSpaceArea();
        this.parkingNumber = basicInformationForm.getParkingNumber();
        this.communityProfile = basicInformationForm.getCommunityProfile();
        this.communityPicture = basicInformationForm.getCommunityPicture();
    }

}
